﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WeiTap.Data.Attributes
{
    [AttributeUsage(AttributeTargets.Property)]
    public class ColumnAttribute:Attribute
    {
        public string Name { get; private set; }
        /// <summary>
        /// string.Format("{0}{1}", paramPrefix, index")
        /// string.Format("CAST({0}{1} AS json")
        /// </summary>
        public string InsertTemplate { get; set; }
        /// <summary>
        /// string.Format("{0}{1}", paramPrefix, index")
        /// string.Format("{0} = CAST({1}{2} AS json)"
        /// </summary>
        public string UpdateTemplate { get; set; }
        public ColumnAttribute() { }
        public ColumnAttribute(string columnName) {
            Name = columnName;
        }
    }
}
